package com.wjp.villagemp.service.impl.manage;

import com.wjp.villagemp.mapper.manage.ScoreMapper;
import com.wjp.villagemp.model.manage.ScoreEntity;
import com.wjp.villagemp.service.manage.ScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Author: Jacob
 * @Date: 2019/1/28 15:49
 * @Description:
 */
@Service
public class ScoreServiceImpl implements ScoreService {
    @Autowired
    private ScoreMapper scoreMapper;

    @Override
    public List<Map<String, Object>> listScore(int pageSize, int start, int studentNum, int courseNum) {
        return scoreMapper.listScore(pageSize, start, studentNum, courseNum);
    }

    @Override
    public Integer countScore(int studentNum, int courseNum) {
        return scoreMapper.countScore(studentNum, courseNum);
    }

    @Override
    public Integer insertScore(ScoreEntity scoreEntity) {
        return scoreMapper.insert(scoreEntity);
    }

    @Override
    public Integer updateScore(ScoreEntity scoreEntity) {
        return scoreMapper.updateByPrimaryKey(scoreEntity);
    }

    @Override
    public Integer removeScore(Integer scoreId) {
        return scoreMapper.deleteByPrimaryKey(scoreId);
    }
}
